home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 May
/
EnigmA AMIGA RUN 18 (1997)(G.R. Edizioni)(IT)[!][issue 1997-05][EAR-CD II].iso
/
softwareupdate
/
system
/
amigados
/
filefunctions
/
example3.c
< prev
next >
Wrap
C/C++ Source or Header
|
1996-10-10
|
2KB
|
84 lines
/***********************************************************/
/* */
/* Amiga C Encyclopedia (ACE) Amiga C Club (ACC) */
/* -------------------------- ------------------ */
/* */
/* Manual: AmigaDOS Amiga C Club */
/* Chapter: File Functions Tulevagen 22 */
/* File: Example3.c 181 41 LIDINGO */
/* Author: Anders Bjerin SWEDEN */
/* Date: 93-03-15 */
/* Version: 1.0 */
/* */
/* Copyright 1993, Anders Bjerin - Amiga C Club (ACC) */
/* */
/* Registered members may use this program freely in their */
/* own commercial/noncommercial programs/articles. */
/* */
/***********************************************************/
/* This example demonstrates how to delete files and */
/* directories. It will delete the file and directory which */
/* we renamed in the previous example. */
/* Include the dos library definitions: */
#include <dos/dos.h>
/* Now we include the necessary function prototype files: */
#include <clib/dos_protos.h> /* General dos functions... */
#include <stdio.h> /* Std functions [printf()...] */
#include <stdlib.h> /* Std functions [exit()...] */
/* Set name and version number: */
UBYTE *version = "$VER: AmigaDOS/FileFunctions/Example3 1.0";
/* Declared our own function(s): */
/* Our main function: */
int main( int argc, char *argv[] );
/* Main function: */
int main( int argc, char *argv[] )
{
/* A simple boolean variable: */
BOOL ok;
/* Delete the file: */
ok = DeleteFile( "RAM:Numbers.dat" );
/* Check if the file was deleted or not: */
if( ok )
printf( "File deleted!\n" );
else
printf( "Error! Could not delete the file!\n" );
/* Delete the directory: */
ok = DeleteFile( "RAM:NewDirectory" );
/* Check if the directory was successfully deleted or not: */
if( ok )
printf( "Directory deleted!\n" );
else
printf( "Error! Could not delete the directory!\n" );
/* The End! */
exit( 0 );
}